<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%>
<%@ page contentType="text/html;charset=UTF-8" %>
<html>
<head>
    <meta charset="UTF-8">
    <title>房屋租赁管理系统</title>
    <link rel="stylesheet" type="text/css" href="/static/themes/default/easyui.css">
    <link rel="stylesheet" type="text/css" href="/static/themes/icon.css">
    <script type="text/javascript" src="/static/jquery-1.9.1.js"></script>
    <script type="text/javascript" src="/static/jquery.easyui.min.js"></script>
    <script type="text/javascript" src="/static/common.js"></script>
</head>
<body>
<body class="easyui-layout">
    <div data-options="region:'north',title:'房屋租赁管理系统',split:false, border:false, collapsible:false"></div>
<%--    <div data-options="region:'south',title:'South Title',split:true" style="height:100px;"></div>--%>
<%--    <div data-options="region:'east',title:'East',split:true" style="width:100px;"></div>--%>
    <div data-options="region:'west',title:'',split:true" style="width:210px;">
        <div id="sm" class="easyui-sidemenu" data-options="data:meun, onSelect:selectMenu"></div>
    </div>
    <div data-options="region:'center',title:''" style="padding:5px;background:#eee;">
        <div id="tb" class="easyui-tabs"></div>
    </div>
</body>
<script type="text/javascript">
    var meun = [{
        text: '业务管理',
        iconCls: 'icon-sum',
        state: 'open',
        children: [{
            text: '房屋管理',
            href: '/house/manage'
        },{
            text: '租赁管理',
            href: '/lease/manage'
        },{
            text: '订单管理',
            href: '/order/manage'
        },{
            text: '故障报修',
            href: '/repair/manage'
        }]
    },{
        text: '系统管理',
        iconCls: 'icon-more',
        children: [{
            text: '用户管理',
            href: '/user/manage'
        },{
            text: '消息管理',
            href: '/message/manage'
        }
        // ,{
        //     text: '测试管理',
        //     href: '/test'
        // }
        ]
    }];

    $(function(){
        initDict();
    });


    /**
     * 选择菜单
     */
    function selectMenu(item) {
        addTab(item.text, item.href);
    }

    /**
     * 添加标签页
     * @param title
     * @param url
     */
    function addTab(title, url){
        if ($('#tb').tabs('exists', title)){
            $('#tb').tabs('select', title);
        } else {
            var content = '<iframe scrolling="auto" frameborder="0"  src="' + url + '" style="width:100%;height:100%;"></iframe>';
            $('#tb').tabs('add',{
                title: title,
                content: content,
                closable: true
            });
        }
    }
</script>
</body>
</html>